import uiautomator2 as u2


d = u2.connect_usb("4bf05af7")
# 滑动解锁操作
# 息屏
# d.screen_off()
# 点亮屏幕
# d.screen_on()
# 解锁
# d.unlock()
# 获取屏幕状态
# print(d.info.get("screenOn"))
# d.unlock()
# home键
# d.press("home")
# 返回键
# d.press("back")

# d.swipe_ext("left")
# d.swipe_ext("right")
# 滑动解锁
# swipe_points

# 先解锁调出九宫格界面
# 0.224, 0.393
# (0.493, 0.395)
# (0.781, 0.396)
# (0.501, 0.551)
# (0.218, 0.705)
# 	(0.501, 0.703)
# (0.773, 0.703)
# duration0.2 是0.2秒
d.unlock()
d.swipe_points(points=[
    (0.224, 0.393),
    (0.493, 0.395),
    (0.781, 0.396),
    (0.501, 0.551),
    (0.218, 0.705),
    (0.501, 0.703),
    (0.773, 0.703)
], duration=0.2)
d.screen_off()
